#include <iterator>
#include <string>
class Solution
{
public:
    string solve(string s, string t)
    {
        int n = s.size() - 1, m = t.size() - 1;
        string sum = "";
        int r = 0;
        while (n >= 0 || m >= 0 || r > 0)
        {
            int a = 0, b = 0;
            if (n >= 0)
            {
                a = s[n] - '0';
                n--;
            }
            if (m >= 0)
            {
                b = t[m] - '0';
                m--;
            }
            int ans = a + b + r;
            if (ans >= 10)
            {
                ans -= 10;
                r = 1;
            }
            else  r = 0;
            sum = to_string(ans) + sum;
        }
        return sum;
    }
};